icontheme: Handle GEmblemIcon in lookup_by_gicon()
authorAlexander Larsson <alexl@redhat.com>
Thu, 6 Feb 2020 09:26:26 +0000 (10:26 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 6 Feb 2020 16:47:52 +0000 (17:47 +0100)
gtk/gtkicontheme.c

index 4911c71eb2a596d6d7ff37ec58c86f2c2967f73a..639c881cdc199a60953edc0b4a2000aae86f96b2 100644 (file)
@@ -3557,6 +3557,10 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme       *self,
   g_return_val_if_fail (GTK_IS_ICON_THEME (self), NULL);
   g_return_val_if_fail (G_IS_ICON (gicon), NULL);
 
+  /* We can't render emblemed icons atm, but at least render the base */
+  while (G_IS_EMBLEMED_ICON (gicon))
+    gicon = g_emblemed_icon_get_icon (G_EMBLEMED_ICON (gicon));
+
   if (GDK_IS_PIXBUF (gicon))
     {
       GdkPixbuf *pixbuf = GDK_PIXBUF (gicon);
@@ -3584,7 +3588,7 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme       *self,
     }
   else
     {
-      g_debug ("Unhandled GIcon type %s", g_type_name_from_instance (gicon));
+      g_debug ("Unhandled GIcon type %s", g_type_name_from_instance ((GTypeInstance *)gicon));
       icon = icon_paintable_new (size, scale);
       icon->filename = g_strdup (IMAGE_MISSING_RESOURCE_PATH);
       icon->is_resource = TRUE;